from PyQt5.QtCore import pyqtSignal, Qt, QThread, QDate, QDateTime, QTime,QRegExp
import sys
import time

class TimeCountThread(QThread):
	updateStartTime = pyqtSignal(str)
	updateRunTime = pyqtSignal(str)
	updateEnd = pyqtSignal(str)
	def __init__(self):
		super(TimeCountThread, self).__init__()

	def run(self):
		date1 = QTime.currentTime()      
		threadStartTime = date1.toString('hh:mm:ss')
		num = 0
		while num < self.data:
			num += 1
			leftTime = self.data - num
			self.updateStartTime.emit(str(threadStartTime))
			self.updateRunTime.emit(str(leftTime))
			if leftTime == 0:
				self.updateEnd.emit("TimeOver")
			time.sleep(1)